<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" aria-labelledby="createOrEditModal" class="modal fade"
    tabindex="-1" role="dialog" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="m-portlet__head-tools width-percent-50 row" style="margin-left:15px;margin-top:30px;">

                <div class="col-6" style="position:relative;">
                    <div class="form-group m-form__group align-items-center">
                        <label>{{l('startEndTime')}}</label>
                        <date-range-picker needInitDate="true" name="SampleDateRangePicker"
                            [showButton]="false" (buttonEmit)="getList()" [(startDate)]="StartTime"
                            [(endDate)]="EndTime" [allowFutureDate]="false">
                        </date-range-picker>
                    </div>
                </div>
                <div class="col-2">
                    <div class="form-group m-form__group align-items-center">
                        <label>&nbsp;</label>
                        <div class="input-group">
                            <button type="button" class="btn btn-primary" [buttonBusy]="primengTableHelper.isLoading"
                                (click)="getList()">
                                <i class="la la-refresh"></i>
                                {{l("search")}}
                            </button>
                        </div>
                    </div>
                </div>

                <button type="button" class="close" (click)="close()" aria-label="Close" style="position:absolute;top:20px;right:30px;font-size:2rem;">
                    <i aria-hidden="true" class="ki ki-close">&times;</i>
                  </button>

            </div>
            <div [class]="containerClass">
                <div class="card card-custom gutter-b">
                    <div class="card-body">
                        <tabset class="tab-container tabbable-line">
                            <tab class="pt-5" heading="{{title}}" customClass="m-tabs__item">
                                <div class="row align-items-center">
                                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                                        <p-table #dataTable (onLazyLoad)="getList($event)" [value]="primengTableHelper.records"
                                            [rows]="primengTableHelper.defaultRecordsCountPerPage" [paginator]="false"
                                            [lazy]="false" [responsive]="primengTableHelper.isResponsive">
                                            <ng-template pTemplate="header">
                                                <tr>
                                                    <th>{{l('RecordId')}}</th>
                                                    <th pSortableColumn="date">
                                                        {{l('buyTime')}}
                                                        <p-sortIcon field="date"></p-sortIcon>
                                                    </th>
                                                    <th pSortableColumn="saleNumber">
                                                        {{l('amount')}}
                                                        <p-sortIcon field="saleNumber"></p-sortIcon>
                                                    </th>
                                                    <th pSortableColumn="saleAmout">
                                                        {{l('TotalSales')}}
                                                        <p-sortIcon field="saleAmout"></p-sortIcon>
                                                    </th>
                                                </tr>
                                            </ng-template>
                                            <ng-template pTemplate="body" let-record let-i="rowIndex">
                                                <tr [pSelectableRow]="record" [attr.trid]="record.id">
                                                    <td style="width:5%"> {{transIndex(i)}}</td>
                                                    <td>
                                                        <span>{{record.date| date : "yyyy/MM/dd"}}</span>
                                                    </td>
                                                    <td>
                                                        <span>{{record.saleNumber}}</span>
                                                    </td>
                                                    <td>
                                                        <span>{{record.saleAmout|currency:'￥'}}</span>
                                                    </td>
                                                </tr>
                                            </ng-template>
                                            <ng-template pTemplate="emptymessage" let-records>
                                                <tr *ngIf="primengTableHelper.records">
                                                    <td colspan="4">
                                                        <img class="emptymessage" src="/assets/common/images/placeholder/productHolder.png" />
                                                    </td>
                                                </tr>
                                            </ng-template>
                                        </p-table>
                                        <div class="primeng-paging-container">
                                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage"
                                                #paginator (onPageChange)="getList($event)" [totalRecords]="primengTableHelper.totalRecordsCount"
                                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                                            </p-paginator>
                                            <span class="total-records-count">
                                                {{l('TotalRecordsCount', primengTableHelper.totalRecordsCount)}}
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </tab>
                        </tabset>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>